diff -c ./alias.c ../../st-bash-src/alias.c
*** ./alias.c	Wed Aug 21 03:39:44 1991
--- ../../st-bash-src/alias.c	Fri Jul 26 15:51:46 1991
***************
*** 92,98 ****
        if ((aliases_length + 1) >= aliases_size)
  	{
  	  aliases =
! 	    (ASSOC **)xrealloc (aliases,
  				(aliases_size += alias_list_grow_amount)
  				* sizeof (ASSOC *));
  	}
--- 92,98 ----
        if ((aliases_length + 1) >= aliases_size)
  	{
  	  aliases =
! 	    (ASSOC **)xrealloc ((char *)aliases,
  				(aliases_size += alias_list_grow_amount)
  				* sizeof (ASSOC *));
  	}
diff -c ./bashline.c ../../st-bash-src/bashline.c
*** ./bashline.c	Sun May 19 17:54:16 1991
--- ../../st-bash-src/bashline.c	Wed Aug 14 11:14:46 1991
***************
*** 35,45 ****
  
  static char
    **attempt_shell_completion (), *bash_tilde_expand (),
!   *variable_completion_function (), *hostname_completion_function (),
    *command_word_completion_function ();
  
  static void
    snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
  
  /* Externally defined functions used by this file. */
  extern char
--- 35,57 ----
  
  static char
    **attempt_shell_completion (), *bash_tilde_expand (),
!   *variable_completion_function (), 
! 
! /**
!  ** (sjk)++ Remove hostname/mail references on the Atari ST.
!  **/
! #if !defined(atarist)
! *hostname_completion_function (),
! #endif
    *command_word_completion_function ();
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
  static void
    snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
+ #endif 
  
  /* Externally defined functions used by this file. */
  extern char
***************
*** 62,69 ****
--- 74,86 ----
    bash_complete_filename_internal (),
    bash_complete_username (), bash_possible_username_completions (),
    bash_complete_username_internal (),
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
    bash_complete_hostname (), bash_possible_hostname_completions (),
    bash_complete_hostname_internal (),
+ #endif 
    bash_complete_variable (), bash_possible_variable_completions (),
    bash_complete_variable_internal (),
    bash_complete_command (), bash_possible_command_completions (),
***************
*** 116,126 ****
--- 133,148 ----
    rl_bind_key_in_map ('~', bash_possible_username_completions,
  		      emacs_ctlx_keymap);
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
    rl_add_defun ("complete-hostname", bash_complete_hostname, META('@'));
    rl_add_defun ("possible-hostname-completions",
  		bash_possible_hostname_completions, -1);
    rl_bind_key_in_map ('@', bash_possible_hostname_completions,
  		      emacs_ctlx_keymap);
+ #endif 
  
    rl_add_defun ("complete-variable", bash_complete_variable, META('$'));
    rl_add_defun ("possible-variable-completions",
***************
*** 211,216 ****
--- 233,242 ----
  /*								    */
  /* **************************************************************** */
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
  /* If the user requests hostname completion, then simply build a list
     of hosts, and complete from that forever more. */
  #if !defined (ETCHOSTS)
***************
*** 255,261 ****
    if (hostname_list_length + 2 > hostname_list_size)
      {
        hostname_list = (char **)
! 	xrealloc (hostname_list,
  		  (1 + (hostname_list_size += 100)) * sizeof (char *));
      }
  
--- 281,287 ----
    if (hostname_list_length + 2 > hostname_list_size)
      {
        hostname_list = (char **)
! 	xrealloc ((char *)hostname_list,
  		  (1 + (hostname_list_size += 100)) * sizeof (char *));
      }
  
***************
*** 412,417 ****
--- 438,444 ----
      }
    return ((char **)NULL);
  }
+ #endif 
  
  /* This is a K*rn shell style insert-last-arg function.  The
     difference is that Bash puts stuff into the history file before
***************
*** 539,548 ****
--- 566,580 ----
  
    /* Another one.  Why not?  If the word starts in '@', then look through
       the world of known hostnames for completion first. */
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
    if (!matches && *text == '@')
      {
        matches = completion_matches (text, hostname_completion_function);
      }
+ #endif 
  
    /* And last, (but not least) if this word is in a command position, then
       complete over possible command names, including aliases, functions,
***************
*** 785,790 ****
--- 817,826 ----
      }
  }
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
  /* How about a completion function for hostnames? */
  static char *
  hostname_completion_function (text, state)
***************
*** 827,832 ****
--- 863,869 ----
    else
      return ((char *)NULL);
  }
+ #endif 
  
  /* History and alias expand the line.  But maybe do more?  This
     is a test to see what users like.  Do expand_string on the string. */
***************
*** 987,993 ****
      {
        if (numitems + 1 > maxitems)
  	ignores = (struct ign *)
! 	  xrealloc (ignores, (maxitems += 10) * sizeof (struct ign));
  
        ignores[numitems].val = colon_bit;
        ignores[numitems].len = strlen (colon_bit);
--- 1024,1030 ----
      {
        if (numitems + 1 > maxitems)
  	ignores = (struct ign *)
! 	  xrealloc ((char *)ignores, (maxitems += 10) * sizeof (struct ign));
  
        ignores[numitems].val = colon_bit;
        ignores[numitems].len = strlen (colon_bit);
***************
*** 1153,1158 ****
--- 1190,1199 ----
    rl_completer_word_break_characters = orig_rl_completer_word_break_characters;
  }
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
  static void
  bash_complete_hostname (ignore, ignore2)
       int ignore, ignore2;
***************
*** 1166,1171 ****
--- 1207,1213 ----
  {
    bash_complete_hostname_internal ('?');
  }
+ #endif 
  
  static void
  bash_complete_variable (ignore, ignore2)
***************
*** 1196,1201 ****
--- 1238,1247 ----
    bash_complete_command_internal ('?');
  }
  
+ /**
+  ** (sjk)++ Remove hostname/mail references on the Atari ST.
+  **/
+ #if !defined(atarist)
  static void
  bash_complete_hostname_internal (what_to_do)
       int what_to_do;
***************
*** 1203,1208 ****
--- 1249,1255 ----
    bash_specific_completion
      (what_to_do, (Function *)hostname_completion_function);
  }
+ #endif 
  
  static void
  bash_complete_variable_internal (what_to_do)
diff -c ./braces.c ../../st-bash-src/braces.c
*** ./braces.c	Thu May 16 04:08:22 1991
--- ../../st-bash-src/braces.c	Fri Jul 26 16:01:46 1991
***************
*** 110,116 ****
  #if defined (SHELL)
    /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
       without doing any expansion.  */
!   if (index (amble, brace_arg_separator) == NULL)
      {
        free (amble);
        free (preamble);
--- 110,116 ----
  #if defined (SHELL)
    /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
       without doing any expansion.  */
!   if (index (amble, brace_arg_separator) == (int)NULL)
      {
        free (amble);
        free (preamble);
***************
*** 164,170 ****
  	  register int lp = array_len (partial);
  	  register int j;
  
! 	  result = (char **)xrealloc (result, (1 + lp + lr) * sizeof (char *));
  
  	  for (j = 0; j < lp; j++)
  	    result[lr + j] = partial[j];
--- 164,170 ----
  	  register int lp = array_len (partial);
  	  register int j;
  
! 	  result = (char **)xrealloc ((char *)result, (1 + lp + lr) * sizeof (char *));
  
  	  for (j = 0; j < lp; j++)
  	    result[lr + j] = partial[j];
diff -c ./builtins.c ../../st-bash-src/builtins.c
*** ./builtins.c	Wed Aug 21 03:39:47 1991
--- ../../st-bash-src/builtins.c	Thu Aug 15 21:35:17 1991
***************
*** 30,35 ****
--- 30,41 ----
  #if defined (HAVE_RESOURCE) && !defined (hpux)
  #include <sys/time.h>
  #include <sys/resource.h>
+ /** 
+  ** (sjk)++ Add sys/times.h on an Atari ST
+  **/
+ #if defined(atarist)
+ #include <sys/times.h>
+ #endif
  #else /* !HAVE_RESOURCE || hpux */
  #include <sys/times.h>
  #endif /* !HAVE_RESOURCE || hpux */
***************
*** 56,63 ****
--- 62,77 ----
  
  /* Yecch!  Who cares about this gross concept in the first place? */
  #ifndef MAXPATHLEN
+ /** 
+  ** (sjk)++ Adjust MAXPATHLEN to jive with definition on the Atari ST. 
+  **         (should be made to depend on standard headers).
+  **/
+ #if !defined(atarist)
  #define MAXPATHLEN 1024
+ #else 
+ #define MAXPATHLEN 128
  #endif
+ #endif
  
  /* The command name of the currently running function. */
  extern char *this_command_name;
***************
*** 1072,1078 ****
    }
  
    if (list)
!     {
        char *extract_colon_unit ();
        char *path_string = get_string_value ("CDPATH");
        char *path;
--- 1086,1092 ----
    }
  
    if (list)
!     { 
        char *extract_colon_unit ();
        char *path_string = get_string_value ("CDPATH");
        char *path;
***************
*** 1080,1087 ****
  
        dirname = list->word->word;
  
!       if (path_string && !absolute_pathname (dirname))
! 	{
  	  while ((path = extract_colon_unit (path_string, &index)))
  	    {
  	      char *dir;
--- 1094,1120 ----
  
        dirname = list->word->word;
  
! /**
!  ** (sjk)++ If on an Atari ST give ?:* a real crack at it.
!  **/
! #if defined(atarist)
!       if ( dirname && (strlen(dirname)>=2) )
!         if (dirname[1]==':')
!           { int i = strlen(dirname);
!             char *dn; dn = alloca(strlen(dirname));
!             --i;
!             strcpy(dn,dirname);
!             if (dn[i] == '/') dn[i]='\000';
!             if (chdir(dn) >= 0) 
!               { strcpy(dirname,dn);
!                 strcpy(the_current_working_directory,dn);
!                 goto bind_and_exit;
! 	      }
!           }
! #endif
!             
!     if (path_string && !absolute_pathname (dirname))
! 	{ /* Path_String && !absolute_pathname */
  	  while ((path = extract_colon_unit (path_string, &index)))
  	    {
  	      char *dir;
***************
*** 2674,2680 ****
        if (!dollar_arg_stack)
  	{
  	  dollar_arg_stack =
! 	    (WORD_LIST **)xrealloc (dollar_arg_stack,
  				    (dollar_arg_stack_slots += 10)
  				    * sizeof (WORD_LIST **));
  	}
--- 2707,2713 ----
        if (!dollar_arg_stack)
  	{
  	  dollar_arg_stack =
! 	    (WORD_LIST **)xrealloc ((char *)dollar_arg_stack,
  				    (dollar_arg_stack_slots += 10)
  				    * sizeof (WORD_LIST **));
  	}
***************
*** 2846,2852 ****
  times_builtin (list)
       WORD_LIST *list;
  {
! #if defined (HAVE_RESOURCE) && !defined (hpux)
    struct rusage self, kids;
  
    no_args (list);
--- 2879,2889 ----
  times_builtin (list)
       WORD_LIST *list;
  {
! 
! /** 
!  ** (sjk)++ Adjust times builtin for Atari ST
!  **/
! #if (defined (HAVE_RESOURCE) && !defined (hpux)) && !defined(atarist)
    struct rusage self, kids;
  
    no_args (list);
***************
*** 3958,3964 ****
  	  if (directory_list_offset == directory_list_size)
  	    {
  	      pushd_directory_list = (char **)
! 		xrealloc (pushd_directory_list,
  			  (directory_list_size += 10) * sizeof (char *));
  	    }
  	  pushd_directory_list[directory_list_offset++] = current_directory;
--- 3995,4001 ----
  	  if (directory_list_offset == directory_list_size)
  	    {
  	      pushd_directory_list = (char **)
! 		xrealloc ((char *)pushd_directory_list,
  			  (directory_list_size += 10) * sizeof (char *));
  	    }
  	  pushd_directory_list[directory_list_offset++] = current_directory;
diff -c ./config.h ../../st-bash-src/config.h
*** ./config.h	Wed Aug 21 03:39:48 1991
--- ../../st-bash-src/config.h	Tue Jun 18 00:05:22 1991
***************
*** 64,70 ****
  
  /* Define JOB_CONTROL if your operating system supports
     BSD-like job control. */
! #define JOB_CONTROL
  
  /* Note that vanilla System V machines don't support BSD job control, 
     although some do support Posix job control. */
--- 64,70 ----
  
  /* Define JOB_CONTROL if your operating system supports
     BSD-like job control. */
! /* #define JOB_CONTROL */
  
  /* Note that vanilla System V machines don't support BSD job control, 
     although some do support Posix job control. */
diff -c ./execute_cmd.c ../../st-bash-src/execute_cmd.c
*** ./execute_cmd.c	Wed Aug 21 03:40:05 1991
--- ../../st-bash-src/execute_cmd.c	Wed Aug 14 11:59:46 1991
***************
*** 1322,1335 ****
  
  	if (!absolute_program (words->word->word))
  	  hashed_file = find_hashed_filename (words->word->word);
! 
  	if (hashed_file)
  	  command = savestring (hashed_file);
  	else
! 	  {
! 	    /* A command containing a slash is not looked up in PATH. */
! 	    if (absolute_program (words->word->word))
! 	      command = savestring (words->word->word);
  	    else
  	      command = find_user_command (words->word->word);
  	    if (command && !hashing_disabled)
--- 1322,1359 ----
  
  	if (!absolute_program (words->word->word))
  	  hashed_file = find_hashed_filename (words->word->word);
!         
  	if (hashed_file)
  	  command = savestring (hashed_file);
  	else
! 	  { if (absolute_program (words->word->word))
!               { 
! /** 
!  ** (sjk)++ Add checking of extensions {.tos/.ttp/.prg} on absolute
!  **         paths on the Atari ST.
!  **/
! #if defined(atarist)
! 		char *name_suffix = alloca(4 + strlen(words->word->word));
!                 struct stat finfo;
!                 strcpy(name_suffix,words->word->word);
!                   if (0 != stat(name_suffix,&finfo))
! 	             { strcat(name_suffix,".tos");
!                        if (0 != stat(name_suffix,&finfo)) 
!                           { strcpy(name_suffix,words->word->word);
!                             strcat(name_suffix,".ttp");
!                             if (0 != stat(name_suffix,&finfo)) 
! 		               { strcpy(name_suffix,words->word->word);
!                                  strcat(name_suffix,".prg");
!                                  if (0 != stat(name_suffix,&finfo))
!                                     strcpy(name_suffix,words->word->word);
! 			       }
! 			  }
! 		     }
!        	          command = savestring (name_suffix);
! #else
! 	          command = savestring (words->word->word);
! #endif
! 	      }
  	    else
  	      command = find_user_command (words->word->word);
  	    if (command && !hashing_disabled)
***************
*** 1350,1357 ****
  	   of COMMAND, since we want the error messages to be redirected. */
        
  	if (make_child (savestring (command_line), async) == 0)
! 	  {
! 	    do_piping (pipe_in, pipe_out);
  
  	    /* Execve expects the command name to be in args[0].  So we
  	       leave it there, in the same format that the user used to
--- 1374,1380 ----
  	   of COMMAND, since we want the error messages to be redirected. */
        
  	if (make_child (savestring (command_line), async) == 0)
! 	  { do_piping (pipe_in, pipe_out);
  
  	    /* Execve expects the command name to be in args[0].  So we
  	       leave it there, in the same format that the user used to
***************
*** 1375,1380 ****
--- 1398,1404 ----
  	    if (do_redirections (simple_command->redirects, 1, 0, 0) == 0)
  	      {
  		signal (SIGCHLD, SIG_DFL);
+ 
  		execve (command, args, export_env);
  
  		/* If we get to this point, then start checking out the file.
***************
*** 1471,1477 ****
  		      /* Insert the name of this shell into the
  			 argument list. */
  		      args =
! 			(char **)xrealloc (args, (1 + larry) * sizeof (char *));
  		      for (i = larry - 1; i; i--)
  			args[i] = args[i - 1];
  
--- 1495,1501 ----
  		      /* Insert the name of this shell into the
  			 argument list. */
  		      args =
! 			(char **)xrealloc ((char *)args, (1 + larry) * sizeof (char *));
  		      for (i = larry - 1; i; i--)
  			args[i] = args[i - 1];
  
***************
*** 1521,1530 ****
  		exit (EXECUTION_FAILURE);
  	      }
  	  }
  	else
! 	  {
! 	    /* Make sure that the pipes are closed in the parent. */
  	    close_pipes (pipe_in, pipe_out);
  	    if (command)
  	      free (command);
  	  }
--- 1545,1561 ----
  		exit (EXECUTION_FAILURE);
  	      }
  	  }
+     
  	else
! 	  { /* Make sure that the pipes are closed in the parent. */
  	    close_pipes (pipe_in, pipe_out);
+       
+ /**
+  ** On the Atari ST force GEMDOS buffers into RTL buffers.
+  **/      
+ #if defined(atarist)
+             flush_key_buff(fileno(stdin));
+ #endif
  	    if (command)
  	      free (command);
  	  }
***************
*** 1892,1898 ****
--- 1923,1937 ----
    return (0);
  }
  
+ /**
+  ** (sjk)++ This is a real kludge to help out our limited implementation of 
+  **         fcntl with F_DUPFD.
+  **/
+ #if defined(atarist)
+ #define SHELL_FD_BASE	4
+ #else
  #define SHELL_FD_BASE	10
+ #endif 
  
  /* Remember the file descriptor associated with the slot FD,
     on REDIRECTION_UNDO_LIST.  Note that the list will be reversed
***************
*** 2111,2118 ****
--- 2150,2189 ----
       char *name;
  {
    char *find_user_command_internal ();
+ /**
+  ** (sjk)++ Check the extensions {.tos/.ttp/.prg} for a user command.
+  **/
+ #if defined(atarist)
+   char *win,*name_suffix;
+   name_suffix = (char *)alloca(4 + strlen(name)); 
+ #endif
  
+ #if !defined(atarist)
+ 
    return (find_user_command_internal (name, 1));
+ 
+ #else  /* Must be an Atari ST */
+ 
+   win = find_user_command_internal(name, 1);
+   if (win != (char *)NULL) return(win);
+  
+   strcpy(name_suffix,name);
+   strcat(name_suffix,".ttp");
+   win = (char *)find_user_command_internal(name_suffix, 1);
+   if (win != (char *)NULL) return(win);
+ 
+   strcpy(name_suffix,name);
+   strcat(name_suffix,".tos");
+   win = (char *)find_user_command_internal(name_suffix, 1);
+   if (win != (char *)NULL) return(win);
+ 
+   strcpy(name_suffix,name);
+   strcat(name_suffix,".prg");
+   win = (char *)find_user_command_internal(name_suffix, 1);
+   if (win != (char *)NULL) return(win);
+ 
+   return(win);
+ #endif                               
  }
  
  /* Locate the file referenced by NAME, searching along the contents
***************
*** 2194,2200 ****
  
  	  if (match_index + 1 == match_list_size)
  	    match_list =
! 	      (char **)xrealloc (match_list,
  				 ((match_list_size += 10) + 1) * sizeof (char *));
  	  match_list[match_index++] = match;
  	  match_list[match_index] = (char *)NULL;
--- 2265,2271 ----
  
  	  if (match_index + 1 == match_list_size)
  	    match_list =
! 	      (char **)xrealloc ((char *)match_list,
  				 ((match_list_size += 10) + 1) * sizeof (char *));
  	  match_list[match_index++] = match;
  	  match_list[match_index] = (char *)NULL;
***************
*** 2266,2274 ****
       a `.' as the directory path yet. */
    dot_found_in_search = 0;
  
    if (absolute_program (name))
      {
!       full_path = (char *)xmalloc (1 + name_len);
        strcpy (full_path, name);
  
        if (executable_file (full_path) || file_exists_p)
--- 2337,2346 ----
       a `.' as the directory path yet. */
    dot_found_in_search = 0;
  
+ 
    if (absolute_program (name))
      {
!       full_path = (char *)xmalloc (1 + strlen(name));
        strcpy (full_path, name);
  
        if (executable_file (full_path) || file_exists_p)
diff -c ./expr.c ../../st-bash-src/expr.c
*** ./expr.c	Wed Aug 21 03:40:05 1991
--- ../../st-bash-src/expr.c	Fri Jul 26 15:50:04 1991
***************
*** 148,154 ****
    if (expr_depth >= expr_stack_size)
      {
        expr_stack = (EXPR_CONTEXT **)
! 	xrealloc (expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  		  * sizeof (EXPR_CONTEXT *));
      }
  
--- 148,154 ----
    if (expr_depth >= expr_stack_size)
      {
        expr_stack = (EXPR_CONTEXT **)
! 	xrealloc ((char *)expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  		  * sizeof (EXPR_CONTEXT *));
      }
  
diff -c ./general.c ../../st-bash-src/general.c
*** ./general.c	Wed Aug 21 03:40:07 1991
--- ../../st-bash-src/general.c	Wed Aug 14 11:58:20 1991
***************
*** 22,27 ****
--- 22,28 ----
  #include <errno.h>
  #include <sys/types.h>
  #include <sys/param.h>
+ 
  #include <fcntl.h>
  
  #include "shell.h"
***************
*** 51,57 ****
  
  char *
  xmalloc (size)
!      int size;
  {
    register char *temp = (char *)malloc (size);
  
--- 52,58 ----
  
  char *
  xmalloc (size)
! long size;
  {
    register char *temp = (char *)malloc (size);
  
***************
*** 64,70 ****
  char *
  xrealloc (pointer, size)
       register char *pointer;
!      int size;
  {
    char *temp;
  
--- 65,71 ----
  char *
  xrealloc (pointer, size)
       register char *pointer;
! long size;
  {
    char *temp;
  
***************
*** 140,148 ****
  unset_nodelay_mode (fd)
       int fd;
  {
    int flags, set = 0;
  
!   if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
      return;
  
  #if defined (O_NONBLOCK)
--- 141,157 ----
  unset_nodelay_mode (fd)
       int fd;
  {
+ 
+ /**
+  ** (sjk)++ We remove the call to make stdin a noblocking stream, since this 
+             is not a feature of our limited fcntl() call. No blocking Input 
+ 	    is however taken care of by the console_input_status()
+             and console_read_byte() pair in the readline source code.
+  **/
+ #if !defined(atarist)
    int flags, set = 0;
  
!   if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
      return;
  
  #if defined (O_NONBLOCK)
***************
*** 163,168 ****
--- 172,178 ----
  
    if (set)
      fcntl (fd, F_SETFL, flags);
+ #endif 
  }
  
  
***************
*** 347,353 ****
--- 357,372 ----
     begin with. */
  
  #ifndef MAXPATHLEN
+ 
+ /**
+  ** (sjk)++ Adjust the MAXPATHLEN on the Atari ST, note that this should be 
+  **         done in a more independent way (by including a standard header).
+  **/
+ #if !defined(atarist)
  #define MAXPATHLEN 1024
+ #else 
+ #define MAXPATHLEN 128
+ #endif
  #endif
  
  static char current_path[MAXPATHLEN];
diff -c ./general.h ../../st-bash-src/general.h
*** ./general.h	Fri May 17 19:58:24 1991
--- ../../st-bash-src/general.h	Wed Aug 14 15:00:28 1991
***************
*** 72,78 ****
  #define SET_CLOSE_ON_EXEC(fd)	(fcntl ((fd), F_SETFD, FD_CLOEXEC))
  #define SET_OPEN_ON_EXEC(fd)	(fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  
- extern char *xmalloc (), *malloc (), *xrealloc (), *realloc ();
  extern char *itos ();
  
  #endif	/* _GENERAL_ */
--- 72,80 ----
  #define SET_CLOSE_ON_EXEC(fd)	(fcntl ((fd), F_SETFD, FD_CLOEXEC))
  #define SET_OPEN_ON_EXEC(fd)	(fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  
  extern char *itos ();
  
  #endif	/* _GENERAL_ */
+ 
+ 
+ 
diff -c ./mailcheck.c ../../st-bash-src/mailcheck.c
*** ./mailcheck.c	Wed Jan 30 17:04:04 1991
--- ../../st-bash-src/mailcheck.c	Wed Aug 14 13:27:38 1991
***************
*** 24,29 ****
--- 24,34 ----
  #include <sys/param.h>
  #include "shell.h"
  
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST1
+  **/
+ #if !defined(atarist)
+ 
  #ifndef MAXPATHLEN
  #define MAXPATHLEN 1024
  #endif
***************
*** 150,155 ****
--- 155,161 ----
    mailfiles_count = 0;
    mailfiles = (FILEINFO **)NULL;
  }
+ #endif 
  
  /* Return the full pathname of FILE.  Easy.  Filenames that begin
     with a '/' are returned as themselves.  Other filenames have
***************
*** 192,197 ****
--- 198,208 ----
    }
  }
  
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST
+  **/
+ #if !defined(atarist)
+ 
  /* Return non-zero if FILE's mod date has changed. */
  file_mod_date_changed (file)
       char *file;
***************
*** 400,402 ****
--- 411,414 ----
    free (mailpaths);
    bind_variable ("_", dollar_underscore);
  }
+ #endif 
diff -c ./nojobs.c ../../st-bash-src/nojobs.c
*** ./nojobs.c	Wed Aug 21 03:40:22 1991
--- ../../st-bash-src/nojobs.c	Wed Aug 14 13:47:32 1991
***************
*** 46,56 ****
  #define SIGABRT SIGIOT
  #endif
  
! #if defined (USG) || defined (_POSIX_VERSION)
  #define killpg(pg, sig)		kill(-(pg),(sig))
  #endif
  
! #if defined (USG)
  #define siginterrupt(sig, code)
  #endif
  
--- 46,62 ----
  #define SIGABRT SIGIOT
  #endif
  
! /**
!  ** (sjk)++ Remove all host/mail references on the Atari ST1
!  **/
! #if defined (USG) || defined (_POSIX_VERSION) || defined(atarist)
  #define killpg(pg, sig)		kill(-(pg),(sig))
  #endif
  
! /**
!  ** (sjk)++ Make siginterrupt() a NULL code on the Atari ST
!  **/
! #if defined (USG) || defined(atarist)
  #define siginterrupt(sig, code)
  #endif
  
***************
*** 150,155 ****
--- 156,168 ----
    return (pid);
  }
  
+ /**
+  ** (sjk)++ Define ECHILD to be an unknown/general ERROR code for the Atari ST
+  **/
+ #if defined(atarist)
+ #define ECHILD (-1)
+ #endif
+ 
  /* Wait for a single pid (PID) and return its exit status. */
  wait_for_single_pid (pid)
       pid_t pid;
***************
*** 189,195 ****
        WAIT status;
  
        while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
! 	;
        if (errno != EINTR && errno != ECHILD)
  	{
  	  siginterrupt (SIGINT, 0);
--- 202,209 ----
        WAIT status;
  
        while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
! 	 printf("Stuck in wait loop with got_pid = %d\n",got_pid);
! 
        if (errno != EINTR && errno != ECHILD)
  	{
  	  siginterrupt (SIGINT, 0);
***************
*** 297,303 ****
--- 311,324 ----
  /* Fill the contents of shell_tty_info with the current tty info. */
  get_tty_state ()
  {
+ /**
+  ** (sjk)++ Attach the terminal to CON: on the Atari ST
+  **/
+ #if !defined(atarist)
    int tty = open ("/dev/tty", O_RDONLY);
+ #else 
+   int tty = open("CON:", O_RDONLY);
+ #endif 
    if (tty != -1)
      {
     
***************
*** 318,324 ****
--- 339,352 ----
  /* Make the current tty use the state in shell_tty_info. */
  set_tty_state ()
  {
+ /**
+  ** (sjk)++ Attach the terminal to CON: on the Atari ST
+  **/
+ #if !defined(atarist)
    int tty = open ("/dev/tty", O_RDONLY);
+ #else 
+   int tty = open("CON:", O_RDONLY);
+ #endif 
    if (tty != -1)
      {
        if (!got_tty_state)
***************
*** 326,336 ****
  #if defined (_POSIX_VERSION)
        tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  #else
! #  if defined (USG)
!       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
! #  else
        ioctl (tty, TIOCSETN, &shell_tty_info);
! #  endif
  #endif
        close (tty);
      }
--- 354,367 ----
  #if defined (_POSIX_VERSION)
        tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  #else
! /** 
!  ** (sjk)++ Set the terminal parameters ala USG if on an Atari ST
!  **/
! #if defined (USG) || defined(atarist)
        ioctl (tty, TIOCSETN, &shell_tty_info);
! #else
!       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
! #endif
  #endif
        close (tty);
      }
diff -c ./parse.y ../../st-bash-src/parse.y
*** ./parse.y	Wed Aug 21 03:40:23 1991
--- ../../st-bash-src/parse.y	Wed Aug 21 02:36:44 1991
***************
*** 671,676 ****
--- 671,680 ----
  /*								    */
  /* **************************************************************** */
  
+ #if defined(atarist)
+ extern int console_read_byte();
+ #endif
+ 
  int
  yy_stream_get ()
  {
***************
*** 678,684 ****
--- 682,695 ----
  #if defined (USG)
      return (sysv_getc (yy_input_dev));
  #else
+ /**
+  ** (sjk)++ Atari ST hack for input
+  **/
+ #if !defined(atarist)
      return (getc (yy_input_dev));
+ #else 
+     return(console_read_byte(fileno(yy_input_dev)));
+ #endif 
  #endif	/* USG */
    else return (EOF);
  }
***************
*** 1349,1354 ****
--- 1360,1370 ----
  {
    if (interactive && (!current_token || current_token == '\n'))
      {
+ 
+ /**
+  ** (sjk)++
+  **/
+ #if !defined(atarist)
        /* Before we print a prompt, we might have to check mailboxes.
  	 We do this only if it is time to do so. Notice that only here
  	 is the mail alarm reset; nothing takes place in check_mail ()
***************
*** 1358,1363 ****
--- 1374,1380 ----
  	  check_mail ();
  	  reset_mail_timer ();
  	}
+ #endif
  
        /* Allow the execution of a random command just before the printing
  	 of each primary prompt.  If the shell variable PROMPT_COMMAND
***************
*** 2183,2189 ****
--- 2200,2210 ----
     of MAXPATHLEN is a crock if you ask me.  Why can't we just have
     dynamically defined sizes?  (UCSB crashes every 20 minutes on me.) */
  #ifndef MAXPATHLEN
+ #if !defined(atarist)
  #define MAXPATHLEN 1024
+ #else 
+ #define MAXPATHLEN 128
+ #endif
  #endif	/* MAXPATHLEN */
  
  /* Return a string which will be printed as a prompt.  The string
diff -c ./shell.c ../../st-bash-src/shell.c
*** ./shell.c	Wed May 22 15:15:02 1991
--- ../../st-bash-src/shell.c	Wed Aug 21 00:26:26 1991
***************
*** 38,43 ****
--- 38,44 ----
  #if !defined (sony)
  #include <fcntl.h>
  #endif /* sony */
+ 
  #include <sys/file.h>
  #include "posixstat.h"
  #include <pwd.h>
***************
*** 132,139 ****
--- 133,148 ----
  
  /* The environment at the top-level REP loop.  We use this in the case of
     error return. */
+ /**
+  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
+  **/
+ #if !defined(atarist)
  jmp_buf top_level, catch;
+ #else 
+ jmp_buf top_level;
+ #endif
  
+ 
  /* Non-zero is the recursion depth for commands. */
  int indirection_level = 0;
  
***************
*** 219,224 ****
--- 228,243 ----
  	     COMPAT_BSDTTY | COMPAT_EXEC | COMPAT_SYSCALLS);
  #endif /* AUX */
  
+ /**
+  ** (sjk)++ Set the default unixmode as we cannot assume that the variable 
+  **         is set upon entering the shell.
+  **/
+ #if defined(atarist)
+  if (!getenv("UNIXMODE")) _set_unixmode("/.,rCLAHdb");
+     else _set_unixmode(getenv("UNIXMODE"));
+ #endif
+ 
+ 
    /* Wait forever if we are debugging a login shell. */
    while (debugging_login_shell);
  
***************
*** 576,581 ****
--- 595,604 ----
    /* Do the things that should be done only for interactive shells. */
    if (interactive)
      {
+ /**
+  ** (sjk)++ Remove all host/mail code on the Atari ST
+  **/
+ #if !defined(atarist)
        /* Set up for checking for presence of mail. */
  #if defined (USG)
        /* Under System V, we can only tell if you have mail if the
***************
*** 599,604 ****
--- 622,628 ----
  	}
  
        reset_mail_timer ();
+ #endif 
  
        change_flag_char ('i', FLAG_ON);
        
***************
*** 898,904 ****
  	      {
  		executing = 1;
  		execute_command (current_command);
! 	      }
  
  	  exec_done:
  	    if (current_command)
--- 922,928 ----
  	      {
  		executing = 1;
  		execute_command (current_command);
!               }
  
  	  exec_done:
  	    if (current_command)
***************
*** 988,994 ****
    /* Only do timeouts if interactive. */
    if (interactive)
      {
!       tmout_var = find_variable ("TMOUT");
  
        if (tmout_var && tmout_var->value)
  	{
--- 1012,1022 ----
    /* Only do timeouts if interactive. */
    if (interactive)
      {
! /**
!  ** (sjk)++ There is no nead to do an interative timeout on the Atari ST
!  **/
! #if !defined(atarist)
!      tmout_var = find_variable ("TMOUT");
  
        if (tmout_var && tmout_var->value)
  	{
***************
*** 999,1004 ****
--- 1027,1033 ----
  	      alarm (tmout_len);
  	    }
  	}
+ #endif
      }
  
    QUIT;
***************
*** 1005,1015 ****
--- 1034,1049 ----
  
    result = parse_command ();
  
+ /**
+  ** (sjk)++ There is no need for an interactive timeout on the Atari ST
+  **/
+ #if !defined(atarist)
    if (interactive && tmout_var && (tmout_len > 0))
      {
        alarm(0);
        signal (SIGALRM, old_alrm);
      }
+ #endif
    return (result);
  }
  
***************
*** 1321,1327 ****
  sigint_sighandler (sig)
       int sig;
  {
! #if defined (USG) && !defined (_POSIX_VERSION)
    signal (sig, sigint_sighandler);
  #endif
  
--- 1355,1364 ----
  sigint_sighandler (sig)
       int sig;
  {
! /**
!  **  (sjk)++ Offer up the signal ala USG on the Atari ST
!  **/
! #if (defined (USG) && !defined(_POSIX_VERSION)) || defined(atarist)
    signal (sig, sigint_sighandler);
  #endif
  
diff -c ./shell.h ../../st-bash-src/shell.h
*** ./shell.h	Mon May 20 05:01:20 1991
--- ../../st-bash-src/shell.h	Wed Aug 14 15:01:15 1991
***************
*** 20,26 ****
--- 20,33 ----
  /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
  
  #include <setjmp.h>
+ /**
+  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
+  **/
+ #if !defined(atarist)
  extern jmp_buf top_level, catch;
+ #else
+ extern jmp_buf top_level;
+ #endif
  
  #define NOT_JUMPED 0		/* Not returning from a longjmp. */
  #define FORCE_EOF 1		/* We want to stop parsing. */
diff -c ./subst.c ../../st-bash-src/subst.c
*** ./subst.c	Wed Aug 21 03:40:25 1991
--- ../../st-bash-src/subst.c	Wed Aug 14 14:42:47 1991
***************
*** 2254,2260 ****
  	     continue.  In the common case, at least when running shell
  	     scripts, this will degenerate to a bunch of calls to `index',
  	     and then what is basically the body of copy_word_list. */
! 	  if (index (tlist->word->word, '{') != NULL)
  	    {
  	      expansions = brace_expand (tlist->word->word);
  
--- 2254,2260 ----
  	     continue.  In the common case, at least when running shell
  	     scripts, this will degenerate to a bunch of calls to `index',
  	     and then what is basically the body of copy_word_list. */
! 	  if (index ((tlist->word->word), '{') != (int)NULL)
  	    {
  	      expansions = brace_expand (tlist->word->word);
  
***************
*** 2451,2459 ****
  
  /* The functions that get called. */
  int
!   sv_path (), sv_mail (), sv_terminal (), sv_histsize (), sv_histfilesize (),
    sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
!   sv_nolinks (), sv_hostname_completion_file (), sv_history_control (),
    sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  
  #if defined (JOB_CONTROL)
--- 2451,2473 ----
  
  /* The functions that get called. */
  int
!   sv_path (),
! /**
!  ** (sjk)++ Remove all host/mail references on the Atari ST
!  **/
! #if !defined(atarist)
!              sv_mail (),
! #endif 
!   sv_terminal (), sv_histsize (), sv_histfilesize (),
    sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
!   sv_nolinks (), 
! /**
!  ** (sjk)++ Remove all host/mail references on the Atari ST
!  **/
! #if !defined(atarist)
!   sv_hostname_completion_file (), 
! #endif 
!   sv_history_control (),
    sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  
  #if defined (JOB_CONTROL)
***************
*** 2465,2473 ****
--- 2479,2492 ----
    Function *function;
  } special_vars[] = {
    { "PATH", sv_path },
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST
+  **/
+ #if !defined(atarist)
    { "MAIL", sv_mail },
    { "MAILPATH", sv_mail },
    { "MAILCHECK", sv_mail },
+ #endif
    { "TERMCAP", sv_terminal },
    { "TERM", sv_terminal },
    { "HISTSIZE", sv_histsize },
***************
*** 2487,2493 ****
--- 2506,2517 ----
    { "allow_null_glob_expansion", sv_allow_null_glob_expansion },
    { "histchars", sv_histchars },
    { "nolinks", sv_nolinks },
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST
+  **/
+ #if !defined(atarist)
    { "hostname_completion_file", sv_hostname_completion_file },
+ #endif
    { "history_control", sv_history_control },
    { "noclobber", sv_noclobber },
    { (char *)0x00, (Function *)0x00 }
***************
*** 2537,2542 ****
--- 2561,2570 ----
  
  /* What to do just after one of the MAILxxxx variables has changed.  NAME
     is the name of the variable.  */
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST
+  **/
+ #if !defined(atarist)
  sv_mail (name)
       char *name;
  {
***************
*** 2555,2560 ****
--- 2583,2589 ----
  	}
      }
  }
+ #endif 
  
  /* What to do just after one of the TERMxxx variables has changed.
     If we are an interactive shell, then try to reset the terminal
***************
*** 2751,2756 ****
--- 2780,2789 ----
    v->attributes |= (att_readonly | att_integer);
  }
  
+ /**
+  ** (sjk)++ Remove all host/mail references on the Atari ST
+  **/
+ #if !defined(atarist)
  sv_hostname_completion_file (name)
       char *name;
  {
***************
*** 2758,2763 ****
--- 2791,2797 ----
  
    hostname_list_initialized = 0;
  }
+ #endif 
  
  sv_allow_null_glob_expansion (name)
       char *name;
diff -c ./trap.c ../../st-bash-src/trap.c
*** ./trap.c	Sun May 19 14:43:41 1991
--- ../../st-bash-src/trap.c	Wed Aug 14 14:51:00 1991
***************
*** 285,293 ****
--- 285,298 ----
  /* Non-zero when we catch a trapped signal. */
  static int catch_flag = 0;
  
+ /**
+  ** (sjk)++ NO BSD type signals on the Atari ST1
+  **/
+ #if !defined(atarist)
  #if !defined (USG) && !defined (USGr4)
  #define HAVE_BSD_SIGNALS
  #endif
+ #endif
  
  run_pending_traps ()
  {
***************
*** 362,368 ****
    if (original_signals[sig] == SIG_IGN)
      return;
  
! #ifdef SIGCHLD
    /* Don't change the function that catches SIGCHLD, but store the command
       to be executed.  It will be run from jobs.c: flush_child(). */
    if (sig && (sig != SIGCHLD))
--- 367,373 ----
    if (original_signals[sig] == SIG_IGN)
      return;
  
! #if  defined(SIGCHLD)
    /* Don't change the function that catches SIGCHLD, but store the command
       to be executed.  It will be run from jobs.c: flush_child(). */
    if (sig && (sig != SIGCHLD))
***************
*** 373,379 ****
  
    change_signal (sig, savestring (string));
  
! #ifdef SIGCHLD
    /* Don't change the function that catches SIGCHLD, but store the command
       to be executed.  It will be run from jobs.c: flush_child(). */
    if (sig && (sig != SIGCHLD))
--- 378,384 ----
  
    change_signal (sig, savestring (string));
  
! #if defined(SIGCHLD)
    /* Don't change the function that catches SIGCHLD, but store the command
       to be executed.  It will be run from jobs.c: flush_child(). */
    if (sig && (sig != SIGCHLD))
***************
*** 401,410 ****
  restore_default_signal (sig)
       int sig;
  {
- #ifdef SIGCHLD
    /* Don't allow the SIGCHLD signal catcher to be overridden. */
    if (sig != SIGCHLD)
- #endif
      signal (sig, original_signals[sig]);
    change_signal (sig, (char *)DEFAULT_SIG);
  }
--- 406,413 ----
***************
*** 414,423 ****
  ignore_signal (sig)
       int sig;
  {
- #ifdef SIGCHLD
    /* Don't allow the SIGCHLD signal catcher to be overridden. */
    if (sig != SIGCHLD)
- #endif
      signal (sig, SIG_IGN);
    change_signal (sig, (char *)IGNORE_SIG);
  }
--- 417,424 ----
diff -c ./ulimit.c ../../st-bash-src/ulimit.c
*** ./ulimit.c	Fri May 17 20:17:03 1991
--- ../../st-bash-src/ulimit.c	Mon Aug 19 15:01:54 1991
***************
*** 29,34 ****
--- 29,40 ----
  #if defined (HAVE_RESOURCE)
  #include <sys/time.h>
  #include <sys/resource.h>
+ /**
+  ** We require some library support on the Atari ST
+  **/
+ #if defined(atarist)
+ #include "../lib+/r-res.h"
+ #endif
  #else
  #include <sys/times.h>
  #endif
diff -c ./variables.c ../../st-bash-src/variables.c
*** ./variables.c	Fri May 17 20:33:53 1991
--- ../../st-bash-src/variables.c	Fri Aug 16 08:45:23 1991
***************
*** 66,76 ****
--- 66,81 ----
  /* The list of variables that may not be unset in this shell. */
  char **non_unsettable_vars = (char **)NULL;
  
+ /**
+  **  (sjk)++ Remove all mail references on the Atari ST 
+  **/
+ #if !defined(atarist)   
  #if defined (USG)
  #define DEFAULT_MAIL_PATH "/usr/mail/"
  #else
  #define DEFAULT_MAIL_PATH "/usr/spool/mail/"
  #endif
+ #endif 
  
  /* Some forward declarations. */
  SHELL_VAR *set_if_not ();	/* returns new or existing entry */
***************
*** 136,141 ****
--- 141,157 ----
  
    /* Now make our own defaults in case the vars that we think are
       important are missing. */
+ 
+ /**
+  ** (sjk)++ We set some default environment variables, provided 
+  **         that they are not defined.
+  **/
+ #if defined(atarist)
+   set_if_not("UNIXMODE","/.,LAHdb");   /* Set a default Unixmode */ 
+   set_if_not("HOME","/dev/A");
+   set_if_not("TERM","vt52");
+ #endif 
+ 
    temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
    set_auto_export (temp_var);
  
***************
*** 150,155 ****
--- 166,175 ----
    temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
    set_auto_export (temp_var);
  
+ /**
+  **  (sjk)++ Remove all mail references on the Atari ST 
+  **/
+ #if !defined(atarist)   
    /* Default MAILPATH, and MAILCHECK. */
    set_if_not ("MAILCHECK", "60");
    if ((get_string_value ("MAIL") == (char *)NULL) &&
***************
*** 166,171 ****
--- 186,192 ----
        bind_variable ("MAILPATH", tem);
        free (tem);
      }
+ #endif
  
    /* Set up $PWD. */
    {
***************
*** 280,286 ****
      set_if_not ("HISTFILE", tem);
      free (tem);
  
!     set_if_not ("HISTSIZE", "500");
      sv_histsize ("HISTSIZE");
    }
  
--- 301,307 ----
      set_if_not ("HISTFILE", tem);
      free (tem);
  
!     set_if_not ("HISTSIZE", "50");
      sv_histsize ("HISTSIZE");
    }
  
***************
*** 350,356 ****
        return;
  
    non_unsettable_vars = (char **)
!     xrealloc (non_unsettable_vars, (2 + i) * sizeof (char *));
    non_unsettable_vars[i] = savestring (name);
    non_unsettable_vars[i + 1] = (char *)NULL;
  }
--- 371,377 ----
        return;
  
    non_unsettable_vars = (char **)
!     xrealloc ((char *)non_unsettable_vars, (2 + i) * sizeof (char *));
    non_unsettable_vars[i] = savestring (name);
    non_unsettable_vars[i + 1] = (char *)NULL;
  }
***************
*** 393,399 ****
  	    {
  	      if (list_index + 1 >= list_size)
  		list = (SHELL_VAR **)
! 		  xrealloc (list, (list_size += 20) * sizeof (SHELL_VAR *));
  
  	      list[list_index++] = var;
  	      list[list_index] = (SHELL_VAR *)NULL;
--- 414,420 ----
  	    {
  	      if (list_index + 1 >= list_size)
  		list = (SHELL_VAR **)
! 		  xrealloc ((char *)list, (list_size += 20) * sizeof (SHELL_VAR *));
  
  	      list[list_index++] = var;
  	      list[list_index] = (SHELL_VAR *)NULL;
***************
*** 1353,1359 ****
  
    size = array_len (temporary_env);
    temporary_env = (char **)
!     xrealloc (temporary_env, (size + 2) * (sizeof (char *)));
  
    temporary_env[size] = (temp);
    temporary_env[size + 1] = (char *)NULL;
--- 1374,1380 ----
  
    size = array_len (temporary_env);
    temporary_env = (char **)
!     xrealloc ((char *)temporary_env, (size + 2) * (sizeof (char *)));
  
    temporary_env[size] = (temp);
    temporary_env[size + 1] = (char *)NULL;
***************
*** 1454,1460 ****
  	  return (array);
  	}
      }
!   array = (char **)xrealloc (array, (2 + array_len (array)) * sizeof (char *));
    array[i++] = savestring (assign);
    array[i] = (char *)NULL;
    return (array);
--- 1475,1481 ----
  	  return (array);
  	}
      }
!   array = (char **)xrealloc ((char *)array, (2 + array_len (array)) * sizeof (char *));
    array[i++] = savestring (assign);
    array[i] = (char *)NULL;
    return (array);
***************
*** 1539,1545 ****
  #if !defined (NeXT)
  char *
  getenv (name)
!      char *name;
  {
    SHELL_VAR *var = find_tempenv_variable (name);
  
--- 1560,1566 ----
  #if !defined (NeXT)
  char *
  getenv (name)
!      const char *name;
  {
    SHELL_VAR *var = find_tempenv_variable (name);
  
